
# rule

%:%.makefile
	@echo compiling module \"$@\"
	make all -f $^
	@echo module \"$@\" compiled

%.clean:%.makefile
	@echo cleaning module \"$@\"
	make clean -f $^
	@echo module \"$@\" cleaned

MODULES_MAKEFILE=$(foreach file,.,$(wildcard $(addprefix *,.makefile)))
MODULES=$(addsuffix , $(basename $(MODULES_MAKEFILE)))
#MODULES_CLEAN=$(addsuffix .clean, $(basename $(MODULES_MAKEFILE)))
MODULES_CLEAN=$(MODULES_MAKEFILE:.makefile=.clean)

all:$(MODULES)
#	@echo $(MODULES)
#	@echo $(MODULES_MAKEFILE)

clean:$(MODULES_CLEAN)
